package cn.itsource.feign;

import cn.itsource.AjaxResult;
import cn.itsource.domain.Store;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreServiceFallback implements FallbackFactory<StoreService> {

    @Override
    public StoreService create(Throwable throwable) {
        throwable.printStackTrace();
        return new StoreService() {
            @Override
            public AjaxResult add(Store store) {
                return new AjaxResult(false,"触发熔断");
            }
        };
    }
}
